<include file="Base/base_header"/>

<body  style="background:#f6f6f8;">
<section  class="wrap">
	<form id="form1" action="javascript:;" method="post">
	<section  class="white_box">
		<dl  class="order">
			<dt  class="pri_img1"> 
				<a  id="oneGiftLink"  title="{$goods['goods_name']}">
					<img  id="oneGiftImg"  src="__ROOT__{$goods['good_img_arr'][0]}"  alt="{$goods['goods_name']}">
				</a>
			</dt>
			<dd  class="pri_info1" style="height: 7rem;">
				<h3  class="pri_tit"> 
					<a  id="oneGiftName"  title="{$goods['goods_name']}">{$goods['goods_name']}</a>
				</h3>
				<p>起拍价：<span  id="oneGiftNeed" class="fc" data-value="{$bid_good['star_price']}">￥{$bid_good['star_price']}</span>，最低加价：<span  id="oneGiftLeft"  class="fc" value="{$bid_good['mini_pricer']}">￥{$bid_good['mini_pricer']}</span>
				</p>
				<div style="font-size: 1.2rem;color: #000;"> 竞拍量
					<div  class="item_amount ">
						<input  id="user_number" type="text"  class="ip_num" disabled  value="{$bid_good['start_number']}">
					</div> 
					<span  class="rec_txt">元</span>
				</div>
				<div  id="oneChangeOpt"  class="rec_box"  style=""> 出价
					<div  class="item_amount ">
						<input  id="per_price"  type="text"  class="ip_num"  value="">
					</div> 
					<span  class="rec_txt">元</span>
				</div>
			</dd>
		</dl>
	</section>
	</form>
	<section  id="oneDoWrap"  class="abs_bottom"  style="">
		<div  class="submit">
			<a id="oneDoChange"  style="float: right;"  href="javascript:submit();"  title="提交"  class="smt_btn">提交出价</a>
		</div>
	</section>
</section>
<script type="text/javascript">
	function submit(){	    
    	var  user_number=$("#user_number").val(),
             per_price=$("#per_price").val(),
             bid_type="{$bid['cate_id']}",
             bid_id="{$bid_good.bid_id}",
             good_id="{$bid_good.id}",
             user_star_price=parseInt({$bid_good['star_price']})+parseInt({$bid_good['mini_pricer']});
             
    	if (per_price<user_star_price) {
    		alert('当前加价小于最低加价！');
    		return false;
    	}

    	$.ajax({
                  type:'POST',
                  data:{
                      good_id:good_id,
                      bid_id:bid_id,
                      user_number:user_number,
                      per_price:per_price,
                      bid_type:bid_type
                    },
                    url:"{:U('ajaxPostUserBid')}",
                    success:function(data){                            
                          if(data.status==1){
                            alert(data.msg);
                          	window.location.reload();
                          }else{
                          	alert(data.msg);
                          }
                    }
            });    
	}
</script>

</body>
</html>